def solve(s, t):
    m = len(s)
    n = len(t)
    if s > t:
        return False
    i = 0
    for c in t:
        if i == m:
            return True
        if s[i] == c:
            i += 1
    if i == m:
        return True
    else:
        return False


if __name__ == "__main__":
    s = "abc"
    t = "ahbgdc"
    print(solve(s, t))
